﻿using Coder.Object2Report;
using Coder.Object2Report.Renders.NPOI;
using Text.Helper;

namespace Fee.IO.Exporters
{
    public class StationExporter : BaseExportor<Station>
    {
        protected override string SheetName => "数据";

        protected override Report<Station> CreateReportStructure(RenderBase render)
        {
            var excelReader = (ExcelRender)render;

            var result = new Report<Station>(render);
            result.Column("名称", f => f.Name);
            result.Column("编码", f => f.Code);
            result.Column("站点类型", f => f.Type.GetEnumDisplayName());
            result.Column("站点服务器区域", f => f.District.Name);
            result.Column("站点提单区域", f => f.OrderDistrict.Name);
            result.Column("状态", f => f.ThirdStationStatus);
            result.Column("户数", f => f.UsersNumber);

            result.Column("是否重客", f => f.IsVip ? "是" : "否");
            result.Column("2017年前建", f => Station.IsBefore2017(f.CreateTime) ? "是" : "否");

            return result;
        }
    }

}